package com.hhlkeepalive.onePx;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.Gravity;
import android.view.Window;
import android.view.WindowManager;

public class SinglePixelActivity extends AppCompatActivity {
    private static final String TAG = "KeepAlive";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Window window = getWindow();
        WindowManager.LayoutParams attributes = window.getAttributes();
        attributes.x = 0;
        attributes.y = 0;
        attributes.gravity = Gravity.LEFT | Gravity.TOP;
        attributes.width = 1;
        attributes.height = 1;
        window.setAttributes(attributes);
        ScreenManager.getInstance(getApplicationContext()).setSinglePixelActivity(this);
        Log.e(TAG,"OnePxActivity--->onCreate");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.e(TAG,"OnePxActivity--->onDestroy");
    }
}
